﻿@{
    ViewBag.Title = "_ListProductVariantAttributeValue";
    Layout = "~/Areas/Admin/Views/Shared/__AdminLayout.cshtml";
}

@section _Head{
<style type="text/css">

    .field-validation-error
    {
        position: absolute;
        display: block;
    }
    
    * html .field-validation-error { position: relative; }
    *+html .field-validation-error { position: relative; }
    
    .field-validation-error span
    {
        position: absolute;
        white-space: nowrap;
        color: red;
        padding: 17px 5px 3px;
        background: transparent url('@Url.Content("~/Content/Common/validation-error-message.png") ') no-repeat 0 0;
    }
    
    /* in-form editing */
    .t-edit-form-container
    {
        width: 350px;
        margin: 1em;
    }
    
    .t-edit-form-container .editor-label,
    .t-edit-form-container .editor-field
    {
        padding-bottom: 1em;
        float: left;
    }
    
    .t-edit-form-container .editor-label
    {
        width: 30%;
        text-align: right;
        padding-right: 3%;
        clear: left;
    }
    
    .t-edit-form-container .editor-field
    {
        width: 60%;
    }
</style>

}
<h1>Quản lý giá trị của thuộc tính</h1>
<div>
    @(Html.Telerik().Grid<Sealight.UI.WebUI.Models.ProductVariantAttributeValueViewModel>().Name("ResultsProduct")
             .DataKeys(keys =>
             {
                 keys.Add(o => o.ProductVariantAttributeValueID);             
             })
                     .ToolBar(commands => commands.Insert().ButtonType(GridButtonType.ImageAndText).ImageHtmlAttributes(new { style = "margin-left:0" }))

.Columns(columns =>
{
    columns.Bound(o => o.ProductVariantAttributeValueID).Hidden();
    columns.Bound(o => o.ProductVariantAttributeID).Hidden();
    columns.Bound(o => o.Name).Title("Tên");
    columns.Bound(o => o.PriceAdjustment).Title("Giá");
    columns.Bound(o => o.WeightAdjustment).Title("Trọng lượng");
    columns.Bound(o => o.DisplayOrder).Width(200).Title("Thứ tự");

    columns.Command(commands =>
    {
        commands.Edit().ButtonType(GridButtonType.Text);
        commands.Delete().ButtonType(GridButtonType.Text);
    }).Width(180).Title("");

}).DataBinding(dataBinding =>
                                                                            dataBinding.Ajax().Select("_ProductVariantAttributeValueSelectAjaxEditing", "Product", new { attributeId = ViewData["productVariantAttributeId"] })
                                                .Insert("_ProductVariantAttributeValueInsertAjaxEditing", "Product", new { attributeId = ViewData["productVariantAttributeId"] })
                                                        .Update("_ProductVariantAttributeValueSaveAjaxEditing", "Product", new { attributeId = ViewData["productVariantAttributeId"] })
                                                        .Delete("_ProductVariantAttributeValueDeleteAjaxEditing", "Product", new { attributeId = ViewData["productVariantAttributeId"] }))
        .Scrollable(scrolling => scrolling.Enabled(true))
        .Sortable(sorting => sorting.Enabled(true))
        .Pageable(paging => paging.Enabled(true))
                .Editable(editing => editing.Mode(GridEditMode.PopUp))
        )
</div>
